/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package asja.bd;
//import

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


/**
 *
 * @author Alice
 * Cria a conexão com o Banco de dados
 */
public class Conexao {
    
    public static Connection getConnection() throws SQLException {

        try {
            //carrega o driver do banco de dados
            Class.forName("com.mysql.jdbc.Driver");
            System.out.println("Conectado com Sucesso!!");
            return DriverManager.getConnection("jdbc:mysql://localhost/ASJA", "root", "");
        }
        catch(ClassNotFoundException e){
            System.out.print("Erro na Conexão");
            throw new SQLException(e.getMessage());
            
        }

    }
    
       
}
